<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <script src="../../assets/iconfont.js"></script>
  <link rel="stylesheet" href="../../assets/css/common.css" />
  <link rel="stylesheet" href="../../assets/element-ui/index.css" />
  <link rel="stylesheet" href="./index.min.css" />
  <title>字符串处理</title>
</head>

<body>
  <div id="app" class="plant-t-str-edit">
    <div class="title">请将要处理的字符串粘贴入文本框内
      <div class="btn copy-btn" @click="handleCopyTextarea"><i class="el-icon-copy-document"></i>复制</div>
      <div class="btn clear-btn" @click="handleClearTextarea"><i class="el-icon-refresh-left"></i>清空</div>
      <div class="btn cancel-btn" @click="handleBackHistory"><i class="el-icon-bottom-left"></i>撤销</div>
      <div class="btn auto-close-btn" :class="{'active':keepMenuModal}" @click="handleAutoCloseChanged"><i class="el-icon-files"></i>保持子窗口</div>
    </div>
    <div class="str-pad">
      <el-input id="strpad1" class="row-num" type="textarea" :rows="10" disabled v-model="textareaRowNum"
        spellcheck="false" onscroll="document.getElementById('strpad2').scrollTop = this.scrollTop;">
      </el-input>
      <el-input id="strpad2" class="value" type="textarea" :rows="10" placeholder="请输入文本内容" v-model="textarea" clearable
        autofocus spellcheck="false" onscroll="document.getElementById('strpad1').scrollTop = this.scrollTop;">
      </el-input>
    </div>
    <div class="str-length"><i class="el-icon-s-claim"></i>有效文本长度：{{textareaLength}}</div>
    <el-divider content-position="left"><i class="el-icon-s-tools"></i> 常用操作</el-divider>
    <div>
      <el-button @click="handleOperate('RemoveSpace')">去前后空格</el-button>
      <el-button @click="handleOperate('RemoveSpaceAll')">去所有空格</el-button>
      <el-button @click="handleOperate('ChangeCase')">转换大小写</el-button>
      <el-button @click="handleOperate('Replace')">条件替换</el-button>
      <el-button @click="handleOperate('Insert')">条件插入</el-button>
      <el-button @click="handleOperate('TrimEnter')">缩进</el-button>
    </div>
    <el-divider content-position="left"><i class="el-icon-s-cooperation"></i> 编码</el-divider>
    <div>
      <el-button @click="handleCode('MD5')">MD5加密</el-button>
      <el-button @click="handleCode('UrlEncode')">UrlEncode编码</el-button>
      <el-button @click="handleCode('UrlDecode')">UrlDecode解码</el-button>
    </div>
    <el-divider content-position="left"><i class="el-icon-s-open"></i> 生成 / 解析</el-divider>
    <div>
      <el-button @click="handleCreate('UUID')">随机UUID</el-button>
      <el-button @click="handleCreate('uuidCreate')">定制UUID</el-button>
      <el-button @click="handleCreate('Timestamp')">实时时间戳</el-button>
      <el-button @click="handleCreate('TimestampDesign')">指定时间戳</el-button>
      <el-button @click="handleCreate('TimestampToDate')">解析时间戳</el-button>
    </div>
    <el-dialog title="条件替换文本" :visible.sync="showReplaceModal" width="60%" :close="handleCloseModal" v-dialogDrag>
      <el-form ref="replaceform" :model="replaceform" :rules="rules.general" label-width="80px">
        <el-form-item label="替换内容" required prop="to">
          <el-input v-model="replaceform.to" placeholder="请输入替换内容" clearable></el-input>
        </el-form-item>
        <el-form-item label="目标文本" required prop="aim">
          <el-input v-model="replaceform.aim" placeholder="请输入目标文本" clearable></el-input>
        </el-form-item>
        <div style="height:5px;"></div>
        <el-divider content-position="left"><i class="el-icon-caret-bottom"></i> 补充条件</el-divider>
        <div style="height:15px;"></div>
        <el-form-item label="包含行数" required>
          <el-radio v-model="replaceform.rowType" :label="0">全部</el-radio>
          <el-radio v-model="replaceform.rowType" :label="1">奇数行</el-radio>
          <el-radio v-model="replaceform.rowType" :label="2">偶数行</el-radio>
        </el-form-item>
        <el-form-item label="排除行数">
          <el-input v-model="replaceform.excludeRow" placeholder="请输入排除行数，多行使用 / 隔开" clearable></el-input>
        </el-form-item>
        <el-row>
          <el-col :span="12">
            <el-form-item label="匹配字符">
              <el-input v-model="replaceform.aimRow" placeholder="请输入匹配字符，此行出现此字符才会执行" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="行内序列">
              <el-input v-model="replaceform.aimIndex" placeholder="请输入行内序列，即每行第几次出现时执行" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12" v-if="replaceform.aimIndex">
            <el-form-item label="序列递增">
              <el-switch v-model="replaceform.aimIndexAutoImprove" active-color="#13ce66" inactive-color="#ff4949">
              </el-switch>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="递增量" v-if="replaceform.aimIndexAutoImprove&&replaceform.aimIndex">
              <el-input-number v-model="replaceform.improveCount"  :min="1" :max="20" label="每次执行增加的序列量"></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button icon="el-icon-refresh-right" @click="resetForm('replaceform')">重置</el-button>
        <el-button icon="el-icon-folder-checked" type="primary" @click="handleOperate('ReplaceSure')">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="条件插入文本" :visible.sync="showInsertModal" width="65%" :close="handleCloseModal">
      <el-form ref="insertform" :model="insertform" :rules="rules.general" label-width="80px">
        <el-row>
          <el-col :span="8" style="max-width:250px;min-width: 130px;">
            <el-form-item label="插入换行" required>
              <el-switch v-model="insertform.isEnter" active-color="#13ce66" inactive-color="#ff4949">
              </el-switch>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item v-if="!insertform.isEnter" label="插入内容" required prop="to">
              <el-input v-model="insertform.to" placeholder="请输入插入内容" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="插入类型" required>
          <el-radio v-model="insertform.insertType" :label="1">自定义</el-radio>
          <el-radio v-model="insertform.insertType" :label="2">行首</el-radio>
          <el-radio v-model="insertform.insertType" :label="3">行尾</el-radio>
        </el-form-item>
        <el-row v-if="insertform.insertType==1">
          <el-col :span="12" style="max-width:250px;min-width: 200px;">
            <el-form-item label="插入到" required>
              <el-select v-model="insertform.type" placeholder="请选择插入方向">
                <el-option label="目标之前" :value="1"></el-option>
                <el-option label="目标之后" :value="2"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="目标字符" required prop="aim">
              <el-input v-model="insertform.aim" placeholder="请输入目标字符" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <div style="height:5px;"></div>
        <el-divider content-position="left"><i class="el-icon-caret-bottom"></i> 补充条件</el-divider>
        <div style="height:15px;"></div>
        <el-form-item label="包含行数" required>
          <el-radio v-model="insertform.rowType" :label="0">全部</el-radio>
          <el-radio v-model="insertform.rowType" :label="1">奇数行</el-radio>
          <el-radio v-model="insertform.rowType" :label="2">偶数行</el-radio>
        </el-form-item>
        <el-form-item label="排除行数">
          <el-input v-model="insertform.excludeRow" placeholder="请输入排除行数，多行使用 / 隔开" clearable></el-input>
        </el-form-item>
        <el-row v-if="insertform.insertType==1">
          <el-col :span="12">
            <el-form-item label="匹配字符">
              <el-input v-model="insertform.aimRow" placeholder="请输入匹配字符，此行出现此字符才会执行" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="行内序列">
              <el-input v-model="insertform.aimIndex" placeholder="请输入行内序列，即每行第几次出现时执行" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button icon="el-icon-refresh-right" @click="resetForm('insertform')">重置</el-button>
        <el-button icon="el-icon-folder-checked" type="primary" @click="handleOperate('InsertSure')">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="生成指定时间戳" :visible.sync="showTimestampModal" width="50%" :close="handleCloseModal">
      <el-form ref="timestampform" :model="timestampform" :rules="rules.general" label-width="80px">
        <el-form-item label="目标日期" prop="datetime" required>
          <el-date-picker v-model="timestampform.datetime" type="datetime" placeholder="选择目标日期时间"></el-date-picker>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button icon="el-icon-refresh-right" @click="resetForm('timestampform')">重置</el-button>
        <el-button icon="el-icon-folder-checked" type="primary" @click="handleCreate('TimestampDesignSure')">确
          定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="定制UUID" :visible.sync="showUUIDModal" width="50%" :close="handleCloseModal">
      <el-form ref="uuidform" :model="uuidform" :rules="rules.uuidform" label-width="80px">
        <el-form-item label="生成长度" required>
          <el-slider v-model="uuidform.length" :min="6" :max="48"></el-slider>
        </el-form-item>
        <el-form-item label="参与成分" prop="contain" required>
          <el-checkbox-group v-model="uuidform.contain">
            <el-checkbox :label="1">数字</el-checkbox>
            <el-checkbox :label="2">字母</el-checkbox>
            <el-checkbox :label="3">下划线 _</el-checkbox>
            <el-checkbox :label="4">句点 .</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="生成数量" required>
          <el-slider v-model="uuidform.count" :min="1" :max="20"></el-slider>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button icon="el-icon-refresh-right" @click="resetForm('uuidform')">重置</el-button>
        <el-button icon="el-icon-folder-checked" type="primary" @click="handleCreate('uuidCreateSure')">确
          定</el-button>
      </span>
    </el-dialog>
  </div>
</body>
<script src="../../assets/js/vue2.js"></script>
<script src="../../assets/js/md5.js"></script>
<script src="../../plugins/dialog/drag.js"></script>
<script src="../../assets/element-ui/index.js"></script>
<script src="../../assets/element-ui/et.js"></script>
<script>
  Vue.config.productionTip = true
  new Vue({
    el: '#app',
    data: {
      plugins: new Plugins(),
      keepMenuModal:false,//是否维持子菜单不自动关
      isUpperCase: false,//是否改变过大小写
      textarea: '',//文本内容
      textareaHistory: [],//文本内容操作历史
      historyLock: false,//文本历史是否锁定
      showReplaceModal: false,//是否显示替换设置框
      replaceform: {
        aim: undefined,
        to: undefined,
        rowType: 0,
        excludeRow: undefined,
        aimRow: undefined,
        aimIndex: undefined,
        aimIndexAutoImprove:false,
        improveCount:1
      },
      showInsertModal: false,//是否显示插入设置框
      insertform: {
        isEnter: false,
        to: undefined,
        insertType: 1,
        type: 1,
        aim: undefined,
        rowType: 0,
        excludeRow: undefined,
        aimRow: undefined,
        aimIndex: undefined
      },
      showTimestampModal: false,
      timestampform: {
        datetime: undefined
      },
      showUUIDModal: false,
      uuidform: {
        length: 16,
        contain: [1, 2],
        count: 1
      },
      uuidFlag: false,//用于uuid生成时16位32位交替生成
      rules: {//校验规则
        general: {
          aim: [
            { required: true, message: '请输入目标文本', trigger: ['blur', 'change'] }
          ],
          to: [
            { required: true, message: '请输入编辑内容', trigger: ['blur', 'change'] }
          ],
          datetime: [
            { required: true, message: '请选择日期时间', trigger: ['blur', 'change'] }
          ],
        },
        uuidform: {
          contain: [
            {
              required: true, validator: (rule, value, callback) => {
                if (value.indexOf(1) == -1 && value.indexOf(2) == -1) {
                  callback(new Error('字母和数字至少需要选择一项'));
                  return
                }
                callback()
              }, trigger: ['blur', 'change']
            }
          ]
        },
      }
    },
    watch: {
      textarea(n, o) {
        if (this.historyLock) {
          this.historyLock = false
          return
        }
        if (o) {
          this.textareaHistory.push(o)
        }
      }
    },
    computed: {
      textareaRowNum() {
        let str = this.textarea
        let value = ''
        str = str.replace(/\r/gi, '')
        str = str.split('\n')
        let n = str.length;
        for (let i = 1; i <= n; i++) {
          value += i + '\n';
        }
        return value
      },
      textareaLength() {
        return this.textarea.trim().length
      },
      lineList() {
        let str = this.textarea.replace(/\r/gi, '')
        return str.split('\n')
      }
    },
    methods: {
      //切换子窗口保持状态
      handleAutoCloseChanged(){
        this.keepMenuModal = !this.keepMenuModal
      },
      //一键复制
      handleCopyTextarea() {
        window.$.sendIpc('main-pad-clipboard', { type: 'text', value: this.textarea })
        this.plugins.notifySuccess('已复制到剪贴板')
      },
      //一键清空
      handleClearTextarea() {
        this.textarea = ''
      },
      //撤销操作
      handleBackHistory() {
        if (this.textareaHistory.length) {
          this.historyLock = true
          let hislist = []
          for (const index in this.textareaHistory) {
            const his = this.textareaHistory[index]
            if (index == this.textareaHistory.length - 1) {
              this.textarea = this.textareaHistory[index]
              continue
            }
            hislist.push(his)
          }
          this.textareaHistory = hislist
        }
      },
      //重置表单
      resetForm(formName) {
        this.$refs[formName].resetFields()
      },
      //常规操作
      handleOperate(mark) {
        if (!this.textarea.length) {
          this.plugins.alertError('请先输入字符')
          return
        }
        switch (mark) {
          case 'RemoveSpace':
            this.textarea = this.textarea.trim()
            this.plugins.notifySuccess('去除成功')
            break
          case 'RemoveSpaceAll':
            this.textarea = this.textarea.replaceAll(' ', '')
            this.plugins.notifySuccess('去除成功')
            break
          case 'ChangeCase':
            this.textarea = this.isUpperCase ? this.textarea.toLowerCase() : this.textarea.toUpperCase()
            this.isUpperCase = !this.isUpperCase
            this.plugins.notifySuccess('转换成功')
            break
          case 'Replace':
            this.showReplaceModal = true
            break
          case 'ReplaceSure':
            this.$refs['replaceform'].validate(valid => {
              if (valid) {
                this.textarea = this.dealStr(this.replaceform, this.replaceform.to)
                this.plugins.notifySuccess('替换成功')
                if(this.replaceform.aimIndexAutoImprove && this.replaceform.aimIndex){
                  //如果开启自增序列，则窗口不关闭，执行后序列增加指定数量
                  this.replaceform.aimIndex = Number(this.replaceform.aimIndex) + this.replaceform.improveCount
                  console.log('replaceform.aimIndex',this.replaceform.aimIndex)
                }else{
                  this.closeAllModal()
                }
                
              }
            })
            break
          case 'Insert':
            this.showInsertModal = true
            break
          case 'InsertSure':
            this.$refs['insertform'].validate(valid => {
              if (valid) {
                //根据行数进行处理
                let replaceValue = undefined
                const toValue = this.insertform.isEnter ? '\n' : this.insertform.to
                if (this.insertform.isEnter) this.insertform.to = undefined
                //判断插入方向
                if (this.insertform.insertType == 1) {
                  //自定义方向
                  if (this.insertform.type == 1) {
                    //插入到目标字符之前
                    replaceValue = toValue + this.insertform.aim
                  } else {
                    //插入到目标字符之后
                    replaceValue = this.insertform.aim + toValue
                  }
                } else {
                  //行首行尾在方法内处理
                  replaceValue = toValue
                }
                this.textarea = this.dealStr(this.insertform, replaceValue)
                this.plugins.notifySuccess('插入成功')
                this.closeAllModal()
              }
            })
            break
          case 'TrimEnter':
            this.textarea = this.textarea.replaceAll(/\r/gi, '')
            this.textarea = this.textarea.replaceAll('\n', '')
            this.plugins.notifySuccess('缩进成功')
            break
        }
      },
      dealStr({ insertType, rowType, excludeRow, aimRow, aimIndex, aim }, replaceValue) {
        let afterList = []
        for (const index in this.lineList) {
          const line = this.lineList[index]
          const lineNum = Number(index) + 1
          if (rowType === 1) {
            //改变奇数行
            if (lineNum % 2 == 0) {
              //偶数行放行
              afterList.push(line)
              continue
            }
          }
          if (rowType === 2) {
            //改变偶数行
            if (lineNum % 2 != 0) {
              //奇数行放行
              afterList.push(line)
              continue
            }
          }
          if (excludeRow) {
            if (excludeRow.trim().length) {
              //存在排除行数的设置
              excludeRow = excludeRow.trim()
              const excludeRowList = excludeRow.split('/')
              if (excludeRowList.indexOf(lineNum + '') > -1) {
                afterList.push(line)
                continue
              }
            }
          }
          if (aimRow) {
            //存在特定行形态的设置
            if (line.indexOf(aimRow) == -1) {
              afterList.push(line)
              continue
            }
          }
          //开始执行 需要区分替换和插入 存在insertType为插入
          if (aimIndex) {
            //存在每行执行目标序列
            const index = Number(aimIndex)
            if (typeof index == 'number') {
              //只替换指定序列
              const lineAimCount = line.split(aim).length - 1
              if (index > lineAimCount) {
                this.plugins.alertError('行内序列:' + index + ' 超出行内目标最少出现次数:' + lineAimCount)
                return
              }
              if (lineAimCount > 1) {
                let dealIndex = 0
                let cacheLine = line
                let holdnum = 0
                for (let i = 1; i <= index; i++) {
                  dealIndex = cacheLine.indexOf(aim) + holdnum
                  cacheLine = cacheLine.replace(aim, '')
                  holdnum += aim.length
                }
                //执行
                afterList.push(line.substr(0, dealIndex) + replaceValue + line.substr(dealIndex + aim.length))
              }
            } else {
              this.plugins.alertError('行内序列只能是数字')
              return
            }
          } else {
            //不存在每行执行序列
            if (insertType === 2) {
              afterList.push(replaceValue + line)
            }
            if (insertType === 3) {
              afterList.push(line + replaceValue)
            }
            if (!insertType || insertType == 1) {
              afterList.push(line.replaceAll(aim, replaceValue))
            }
          }
        }
        return afterList.join('\n')
      },
      //监听编码操作
      handleCode(mark) {
        if (!this.textarea.trim().length) {
          this.plugins.alertError('请先输入字符')
          return
        }
        switch (mark) {
          case 'MD5':
            this.textarea = MD5(this.textarea)
            break
          case 'UrlEncode':
            this.textarea = encodeURIComponent(this.textarea)
            break
          case 'UrlDecode':
            this.textarea = decodeURIComponent(this.textarea)
            break
        }
      },
      //监听生成
      handleCreate(mark) {
        switch (mark) {
          case 'UUID':
            this.textarea += (this.textarea ? '\n' : '') + this.createUUID()
            break
          case 'uuidCreate':
            this.showUUIDModal = true
            break
          case 'uuidCreateSure':
            this.$refs['uuidform'].validate(valid => {
              if (valid) {
                let result = ''
                const count = this.uuidform.count
                for (let i = 0; i < count; i++) {
                  result += (i == 0 ? '' : '\n') + this.createUUIDMyself(this.uuidform.length, this.uuidform.contain)
                }
                this.textarea = result
                this.plugins.notifySuccess('生成定制UUID成功')
                this.closeAllModal()
              }
            })
            break
          case 'Timestamp':
            this.textarea += (this.textarea ? '\n' : '') + new Date().getTime()
            break
          case 'TimestampDesign':
            this.showTimestampModal = true
            break
          case 'TimestampDesignSure':
            this.$refs['timestampform'].validate(valid => {
              if (valid) {
                this.textarea += (this.textarea ? '\n' : '') + this.timestampform.datetime.getTime()
                this.plugins.notifySuccess('生成时间戳成功')
                this.closeAllModal()
              }
            })
            break
          case 'TimestampToDate':
            const min = new Date('1-01-01 00:00:00').getTime()
            const max = new Date('3000-12-31 23:59:59').getTime()
            const lineList = this.textarea.split('\n')
            let afterList = []
            for (const line of lineList) {
              if (! /^\d+$/.test(line) || Number(line) < min || Number(line) > max) {
                afterList.push(line)
                continue
              }
              const date = new Date(Number(line))
              const month = (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
              const dateStr = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
              const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
              const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
              const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
              const lineAfter = date.getFullYear() + '-' + month + '-' + dateStr + ' ' + hours + ':' + minutes + ':' + seconds
              afterList.push(lineAfter)
            }
            this.textarea = afterList.join('\n')
            this.plugins.notifySuccess('解析时间戳成功')
            break
        }
      },
      //条件生成UUID
      createUUID(len = 16, radix = undefined) {
        if (this.uuidFlag) {
          len = 32
        }
        this.uuidFlag = !this.uuidFlag
        var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
        var uuid = [], i;
        radix = radix || chars.length;
        if (len) {
          for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
        } else {
          var r;
          uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
          uuid[14] = '4';
          for (i = 0; i < 36; i++) {
            if (!uuid[i]) {
              r = 0 | Math.random() * 16;
              uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
            }
          }
        }
        return uuid.join('');
      },
      //定制生成UUID
      createUUIDMyself(len = 16, contain) {
        var chars = ''
        if (contain.indexOf(1) > -1) {
          chars += '012345678901234567890123456789'
        }
        if (contain.indexOf(2) > -1) {
          chars += 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
        }
        chars = chars.split('');
        var uuid = [], i;
        let radix = chars.length;
        if (len) {
          for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
        } else {
          var r;
          uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
          uuid[14] = '4';
          for (i = 0; i < 36; i++) {
            if (!uuid[i]) {
              r = 0 | Math.random() * 16;
              uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
            }
          }
        }
        let numAndStr = uuid.join('')
        let xiahuaIndex = 0, endIndex = 0
        if (contain.indexOf(3) > -1) {
          xiahuaIndex = Math.floor(Math.random() * len)
          numAndStr = numAndStr.substr(0, xiahuaIndex) + '_' + numAndStr.substr(xiahuaIndex + 1)
        }
        if (contain.indexOf(4) > -1) {
          endIndex = Math.floor(Math.random() * len)
          while (xiahuaIndex == endIndex) {
            endIndex = Math.floor(Math.random() * len)
          }
          numAndStr = numAndStr.substr(0, endIndex) + '.' + numAndStr.substr(endIndex + 1)
        }
        return numAndStr;
      },
      //监听modal关闭
      handleCloseModal() {
        this.showReplaceModal = false
        this.showInsertModal = false
        this.showTimestampModal = false
        this.showUUIDModal = false
      },
      //主动关闭窗口
      closeAllModal(){
        if(this.keepMenuModal){
          return
        }
        this.handleCloseModal()
      }
    }
  })
</script>

</html>